package com.cib.process.chat.core.selector;

import com.cib.process.bean.Actions;
import com.cib.process.bean.IvrRequestServer;
import com.cib.process.bean.QueryRequestParam;
import com.cib.process.chat.core.AbstractActionSeletor;
import com.cib.process.util.ContextUtil;

import javax.swing.*;
import java.util.Map;

public class TTSActionSeletor extends AbstractActionSeletor {
    private boolean collectConversation =false;
    @Override
    public void paramSelector(IvrRequestServer ivrRequestServer, QueryRequestParam queryRequestParam) {
        String lastAction = ivrRequestServer.getLastAction();
        if (Actions.TTS.getCode().equals(lastAction)){
            handleLastResult(ivrRequestServer,queryRequestParam);
        }
    }

    @Override
    public void setCollectConversation(QueryRequestParam queryRequestParam) {
        queryRequestParam.setCollectConversation(collectConversation);
    }

    @Override
    protected String setQueryText(Map<String, String> lastResult) {
        return ContextUtil.handleContext(lastResult.get("context"));
    }
}
